(function(window, doc) {
	var x = window.x = function() {
		this.isMobile = navigator.userAgent.match(/(iPhone|iPod|Android|ios|SymbianOS)/i)
	}

	window.localStorageJson = function(key, value, setVal) {
		var _value = localStorage.getItem(key);
		if ((undefined == _value) || ((undefined != value) && setVal)) {
			_value = JSON.stringify(value, function(k, v) {
				return typeof v == 'function' ? v.toLocaleString() : v
			}, 2);
			localStorage.setItem(key, _value);
		}
		if (!_value) {
			return null;
		}
		return JSON.parse(_value, function(k, v) {
			if (typeof v == 'string' && v.indexOf('function (') == 0) {
				return eval(k + '=' + v + ';' + k);
			}
			return v;
		});
	}
})(window, document);